package kr.hkit.PowerJava.chapter12.work;

import java.util.Arrays;

public class PersonTest {
public static void main(String[] args) {
	Person[] arr = new Person[3];
	arr[0] = new Person("김태희", 180);
	arr[1] = new Person("이민정", 190);
	arr[2] = new Person("태연", 160);
	
	//prnArr(arr);
	System.out.println("가장 키가 큰 사람은 : "+ getMaxium(arr));
	
		
    	
	
}
  private static void prnArr(Person[] arr) {
	for(Person p: arr){
		System.out.println(p);
	}
	
}
public static Person getMaxium(Person[] array){
      Arrays.sort(array);
    //  prnArr(array);
      return array[array.length-1].getName();  

}
}
